/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.unesp.rc.rafaelt.model.bean;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

import com.sun.istack.NotNull;

/**
 *
 * @author rafaelt
 */
@Embeddable
public class MarkPK implements Serializable {
	private static final long serialVersionUID = 1L;
	
	@Basic(optional = false)
    @NotNull
    @Column(name = "student_idStudent")
    private long studentidStudent;
	
    @Basic(optional = false)
    @NotNull
    @Column(name = "subject_idSubject")
    private long subjectidSubject;

    public MarkPK() {
    }

    public MarkPK(long studentidStudent, long subjectidSubject) {
        this.studentidStudent = studentidStudent;
        this.subjectidSubject = subjectidSubject;
    }

    public long getStudentidStudent() {
        return studentidStudent;
    }

    public void setStudentidStudent(long studentidStudent) {
        this.studentidStudent = studentidStudent;
    }

    public long getSubjectidSubject() {
        return subjectidSubject;
    }

    public void setSubjectidSubject(long subjectidSubject) {
        this.subjectidSubject = subjectidSubject;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) studentidStudent;
        hash += (int) subjectidSubject;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MarkPK)) {
            return false;
        }
        MarkPK other = (MarkPK) object;
        if (this.studentidStudent != other.studentidStudent) {
            return false;
        }
        if (this.subjectidSubject != other.subjectidSubject) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.unesp.rc.model.bean.MarkPK[ studentidStudent=" + studentidStudent + ", subjectidSubject=" + subjectidSubject + " ]";
    }
    
}
